import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import { getTeacherList } from '../classManagement/ClassManagement.api';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '序号',
    align:"center",
    dataIndex: 'Id',
    width: 80,

   },
   {
    title: '学生姓名',
    align:"center",
    dataIndex: 'studentName',
    width: 160
   },
   {
    title: '学号',
    align:"center",
    dataIndex: 'studentId',
    width: 200
   },
  
   {
    title: '实验课班级',
    align:"center",
    dataIndex: 'classId',
    width: 200
   },
   {
    title: '所属院系',
    align:"center",
    dataIndex: 'departmentId',
    width: 200
   },
   {
    title: '所属专业',
    align:"center",
    dataIndex: 'majorId',
    width: 200
   },
   {
    title: '所属班级',
    align:"center",
    dataIndex: 'classId',
    width: 200
   },
  
   
];
//查询数据
export const searchFormSchema: FormSchema[] = [
 
  {
    label: '学生姓名',
    field: 'studentName',
    component: 'JInput',
    colProps: { span: 4},
  },
  {
    label: '学生学号',
    field: 'studentId',
    component: 'JInput',
   colProps: { span: 4},
  },
  {
    label: '实验课班级',
    field: 'classId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'classId',
      placeholder: '请选择',
      stringToNumber: true,
    },
    colProps: { span: 5},
  },
  {
    label: '所属院系',
    field: 'departmentId',
  
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'departmentId',
      placeholder: '请选择',
      stringToNumber: true,
    }, 
  /*   component: 'ApiSelect',
    componentProps: {
      
      api: getTeacherList,
      labelField: 'studentName',
      valueField: 'studentId',
      immediate: false,
    }, */
  
    colProps: { span: 5},
   
  },
 

];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '所属大学',
    field: 'schoolId',
    
    required: true,
     component: 'ApiSelect',
        componentProps: {
          // mode: 'multiple',
          api: getTeacherList,
          labelField: 'studentName',
          valueField: 'studentId',
          immediate: false,
        },
  },
  {
    label: '所属院系',
    field: 'departmentId',
   
    required: true,
    component: 'ApiSelect',
    componentProps: {
      // mode: 'multiple',
      api: getTeacherList,
      labelField: 'departmentName',
      valueField: 'departmentId',
      immediate: false,
    },
  },
  {
    label: '所属专业',
    field: 'majorId',
    
    required: true,
     component: 'ApiSelect',
        componentProps: {
          // mode: 'multiple',
          api: getTeacherList,
          labelField: 'majorName',
          valueField: 'majorId',
          immediate: false,
        },
  },
  {
    label: '入学时间',
    field: 'entryTime',
    component: 'Input',
    required: true,
  },
  {
    label: '学生学号',
    field: 'studentId',
    component: 'Input',
    required: true,
  },
  {
    label: '学生姓名',
    field: 'studentName',
    component: 'Input',
    required: true,
  },
  {
    label: '登录账号',
    field: 'username',
    component: 'Input',
    required: true,
  },
  {
    label: '所属实验课班级',
    field: 'classId',
    component: 'ApiSelect',
      componentProps: {
       api: getTeacherList,
        labelField: 'roleName',
        valueField: 'id',
        immediate: false,
      },
    
    required: true,
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  departmentId: {title: '院校主键',order: 0,view: 'text', type: 'string',},
  collegesId: {title: '院系主键',order: 1,view: 'text', type: 'string',},
  majorId: {title: '专业主键',order: 2,view: 'text', type: 'string',},
  studentNumber: {title: '学号',order: 3,view: 'text', type: 'string',},
  studentName: {title: '学生姓名',order: 4,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
